import { T_srv, Tsrv, ifs, ts, tvs, vue } from '@/services';
import { I_cmd, T_cmd } from './command';
import { N_cAlarmQuery } from './types';

function treeConfig() {
  return {
    name: '',
    comment: '',
    isCreated: false,
    status: '',
    dbType: 'mysql',
    tableStyle: {
      showHeader: true,
      showFooter: false,
      showToolbar: true,
      border: true,
      mode: 'nav'
    },
    tableColumns: [],
    uniqueIndexes: [],
    indexes: [],
    rules: [],
    toolbar: {
      default: true,
      expandAll: true,
      contractAll: true,
      mutiSelect: true,
      addon: []
    },
    tableDataSetting: {
      editable: true
    },
    tableDataSource: {
      main: {
        name: 'dimension_query',
        fields: [
          {
            field: 'p_id',
            keyField: false,
            childField: true,
            isShow: false,
            filter: ''
          },
          {
            field: 'alarm_classification',
            keyField: true,
            childField: false,
            isShow: true,
            filter: ''
          },
          {
            field: 'content',
            keyField: false,
            childField: false,
            isShow: false,
            filter: ''
          }
        ],
        id: '581679657561944064'
      }
    },
    messageConfig: {
      custDefListener: {
        coordination: 'EC87030C097418F5'
      },
      emitActions: {
        search: [
          {
            toID: '90B90927AC0868CD',
            msg: {
              type: 'search',
              content: {
                ikey: 'id',
                ukey: 'p_id',
                val: ''
              }
            },
            sourceToID: 'dimension_query'
          }
        ],
        refresh: []
      },
      eventGroup: {
        '': {
          custDefListener: {
            coordination: 'EC87030C097418F5'
          },
          children: [
            {
              // eslint-disable-next-line camelcase
              dimension_query: {
                custDefListener: {
                  coordination: 'B56557B54B469CA2'
                },
                children: []
              }
            }
          ]
        }
      }
    }
  };
}

// 生产过程配置
function workProcessConfig() {
  return {
    layoutID: 38,
    name: 'layout',
    type: 'layout',
    config: {
      mode: 'v',
      value: 0.5,
      first: {
        moduleID: '1',
        name: 'BaseGrid',
        type: 'comp',
        category: 'baseData',
        config: {
          name: 'alarm_query',
          mainFun: 'alarm_query',
          comment: '',
          isCreated: false,
          status: 'main',
          tableStyle: {
            showHeader: true,
            showFooter: false,
            showPager: true,
            showToolbar: true,
            border: false,
            mode: null
          },
          editWindow: false,
          tableGraphMode: false,
          dbType: 'mysql',
          tableColumns: [
            {
              fieldID: '549069322199257088',
              field: '_audited_',
              type: 'int(5)',
              isShow: false,
              notNull: true,
              defValue: 0,
              comment: '',
              selectionID: '408533419782307840',
              disabled: true,
              defaultFilter: false,
              fixedLeft: false,
              fixedRight: false,
              nodeData: false,
              footerMethod: null,
              formatter: {
                type: '',
                decimal: 0,
                thousandmark: false,
                currency: ''
              },
              actions: [],
              cascadeFilter: '',
              auxProp: '',
              minWidth: '',
              appWeight: '',
              isDes: false,
              many2one: {
                toTable: '',
                toField: '',
                isDropdown: false,
                customSearch: '',
                multiConnect: '',
                isFunLayout: true,
                fields: []
              },
              align: 'left',
              subQuery: ''
            },
            {
              fieldID: '549070605010358272',
              field: '_status_',
              type: 'int(5)',
              isShow: false,
              notNull: true,
              defValue: 0,
              comment: '',
              selectionID: '408536001896513536',
              disabled: true,
              defaultFilter: false,
              fixedLeft: false,
              fixedRight: false,
              nodeData: false,
              footerMethod: null,
              formatter: {
                type: '',
                decimal: 0,
                thousandmark: false,
                currency: ''
              },
              actions: [],
              cascadeFilter: '',
              auxProp: '',
              minWidth: '',
              appWeight: '',
              isDes: false,
              many2one: {
                toTable: '',
                toField: '',
                isDropdown: false,
                customSearch: '',
                multiConnect: '',
                isFunLayout: true,
                fields: []
              },
              align: 'left',
              subQuery: ''
            },
            {
              fieldID: '549070114536837120',
              field: '_previous_status_',
              type: 'int(5)',
              isShow: false,
              notNull: true,
              defValue: 0,
              comment: '',
              selectionID: '408536001896513536',
              disabled: true,
              defaultFilter: false,
              fixedLeft: false,
              fixedRight: false,
              nodeData: false,
              footerMethod: null,
              formatter: {
                type: '',
                decimal: 0,
                thousandmark: false,
                currency: ''
              },
              actions: [],
              cascadeFilter: '',
              auxProp: '',
              minWidth: '',
              appWeight: '',
              isDes: false,
              many2one: {
                toTable: '',
                toField: '',
                isDropdown: false,
                customSearch: '',
                multiConnect: '',
                isFunLayout: true,
                fields: []
              },
              align: 'left',
              subQuery: ''
            },
            {
              fieldID: '222301287968935950',
              field: 'create_time',
              type: 'datetime(3)',
              isShow: true,
              notNull: false,
              defValue: '',
              comment: 'alarm_time',
              selectionID: null,
              disabled: true,
              defaultFilter: true,
              fixedLeft: false,
              fixedRight: false,
              footerMethod: null,
              formatter: {
                type: '',
                decimal: 0,
                thousandmark: false,
                currency: ''
              },
              actions: [],
              cascadeFilter: '',
              auxProp: '',
              minWidth: '',
              appWeight: '',
              isDes: false,
              many2one: {
                toTable: '',
                toField: '',
                isDropdown: false,
                customSearch: '',
                multiConnect: '',
                isFunLayout: true,
                fields: []
              },
              align: 'left',
              subQuery: '',
              nodeData: false,
              notDel: false
            },
            {
              fieldID: '222301287968935948',
              field: 'last_modify_user',
              type: 'bigint(20)',
              isShow: false,
              notNull: false,
              defValue: '',
              comment: '',
              selectionID: null,
              disabled: true,
              defaultFilter: false,
              fixedLeft: false,
              fixedRight: false,
              footerMethod: null,
              formatter: {
                type: '',
                decimal: 0,
                thousandmark: false,
                currency: ''
              },
              actions: [],
              cascadeFilter: '',
              auxProp: '',
              minWidth: '',
              appWeight: '',
              isDes: false,
              many2one: {
                toTable: '_sys_user',
                toField: 'user_name',
                isDropdown: false,
                customSearch: '',
                multiConnect: '',
                fields: [],
                isFunLayout: true
              },
              align: 'left',
              subQuery: '',
              nodeData: false,
              notDel: false
            },
            {
              fieldID: '222301287968935947',
              field: 'last_modify_time',
              type: 'datetime(3)',
              isShow: false,
              notNull: false,
              defValue: '',
              comment: '',
              selectionID: null,
              disabled: true,
              defaultFilter: false,
              fixedLeft: false,
              fixedRight: false,
              footerMethod: null,
              formatter: {
                type: '',
                decimal: 0,
                thousandmark: false,
                currency: ''
              },
              actions: [],
              cascadeFilter: '',
              auxProp: '',
              minWidth: '',
              appWeight: '',
              isDes: false,
              many2one: {
                toTable: '',
                toField: '',
                isDropdown: false,
                customSearch: '',
                multiConnect: '',
                isFunLayout: true,
                fields: []
              },
              align: 'left',
              subQuery: '',
              nodeData: false,
              notDel: false
            },
            {
              fieldID: '589276475556696064',
              field: 'release_time',
              type: 'datetime',
              isShow: true,
              notNull: false,
              defValue: '',
              comment: '',
              selectionID: null,
              disabled: false,
              defaultFilter: false,
              fixedLeft: false,
              fixedRight: false,
              nodeData: false,
              footerMethod: null,
              formatter: {
                type: '',
                decimal: 0,
                thousandmark: false,
                currency: ''
              },
              actions: [],
              cascadeFilter: '',
              auxProp: '',
              minWidth: '',
              appWeight: '',
              isDes: false,
              many2one: {
                toTable: '',
                toField: '',
                isDropdown: false,
                customSearch: '',
                multiConnect: '',
                isFunLayout: true,
                fields: []
              },
              align: 'left',
              subQuery: ''
            },
            {
              fieldID: '583863428579135488',
              field: 'alarm_tag_num',
              type: 'varchar(25)',
              isShow: true,
              notNull: false,
              defValue: '',
              comment: '',
              selectionID: null,
              disabled: false,
              defaultFilter: false,
              fixedLeft: false,
              fixedRight: false,
              nodeData: false,
              footerMethod: null,
              formatter: {
                type: '',
                decimal: 0,
                thousandmark: false,
                currency: ''
              },
              actions: [],
              cascadeFilter: '',
              auxProp: '',
              minWidth: '',
              appWeight: '',
              isDes: true,
              many2one: {
                toTable: '',
                toField: '',
                isDropdown: false,
                customSearch: '',
                multiConnect: '',
                isFunLayout: true,
                fields: []
              },
              align: 'left',
              subQuery: ''
            },
            {
              fieldID: '578967476093390848',
              field: 'alarm_id',
              type: 'bigint(20)',
              isShow: true,
              notNull: false,
              defValue: '',
              comment: 'alarm_message',
              selectionID: null,
              disabled: false,
              defaultFilter: true,
              fixedLeft: false,
              fixedRight: false,
              nodeData: false,
              footerMethod: null,
              formatter: {
                type: '',
                decimal: 0,
                thousandmark: false,
                currency: ''
              },
              actions: [],
              cascadeFilter: '',
              auxProp: '',
              minWidth: '',
              appWeight: '',
              isDes: false,
              many2one: {
                toTable: 'dimension_query',
                toField: 'alarm_classification',
                isDropdown: false,
                customSearch: '',
                multiConnect: '',
                isFunLayout: true,
                fields: []
              },
              align: 'left',
              subQuery: ''
            },
            {
              fieldID: '580690817330253824',
              field: 'equip_id',
              type: 'bigint(20)',
              isShow: true,
              notNull: false,
              defValue: '',
              comment: '',
              selectionID: null,
              disabled: false,
              defaultFilter: true,
              fixedLeft: false,
              fixedRight: false,
              nodeData: false,
              footerMethod: null,
              formatter: {
                type: '',
                decimal: 0,
                thousandmark: false,
                currency: ''
              },
              actions: [],
              cascadeFilter: '',
              auxProp: '',
              minWidth: '',
              appWeight: '',
              isDes: false,
              many2one: {
                toTable: 'equip_account',
                toField: 'equip_name',
                isDropdown: false,
                customSearch: '',
                multiConnect: '',
                isFunLayout: true,
                fields: []
              },
              align: 'left',
              subQuery: ''
            },
            {
              fieldID: '549271671144468480',
              field: 'hang_group_id',
              type: 'bigint(20)',
              isShow: true,
              notNull: false,
              defValue: '',
              comment: 'product_hang_group',
              selectionID: null,
              disabled: false,
              defaultFilter: false,
              fixedLeft: false,
              fixedRight: false,
              nodeData: false,
              footerMethod: null,
              formatter: {
                type: '',
                decimal: 0,
                thousandmark: false,
                currency: ''
              },
              actions: [],
              cascadeFilter: '',
              auxProp: '',
              minWidth: '',
              appWeight: '',
              isDes: false,
              many2one: {
                toTable: 'produc_line_detail_mgmt',
                toField: 'hang_group_num',
                isDropdown: false,
                customSearch: '',
                multiConnect: '',
                isFunLayout: true,
                fields: []
              },
              align: 'left',
              subQuery: ''
            },
            {
              fieldID: '542654301940502528',
              field: 'process_flow_num',
              type: 'bigint(20)',
              isShow: false,
              notNull: false,
              defValue: '',
              comment: '',
              selectionID: null,
              disabled: true,
              defaultFilter: false,
              fixedLeft: false,
              fixedRight: false,
              nodeData: false,
              footerMethod: null,
              formatter: {
                type: '',
                decimal: 0,
                thousandmark: false,
                currency: ''
              },
              actions: [],
              cascadeFilter: '',
              auxProp: '',
              minWidth: '',
              appWeight: '',
              isDes: false,
              many2one: {
                toTable: '',
                toField: '',
                isDropdown: false,
                customSearch: '',
                multiConnect: '',
                isFunLayout: true,
                fields: []
              },
              align: 'left',
              subQuery:
                'SELECT process_flow_num FROM produc_line_detail_mgmt WHERE alarm_query.hang_group_id = produc_line_detail_mgmt.id LIMIT 1'
            },
            {
              fieldID: '408513584163717120',
              field: 'createor',
              type: 'bigint(20)',
              isShow: true,
              notNull: false,
              defValue: '',
              comment: 'operator',
              selectionID: null,
              disabled: true,
              defaultFilter: false,
              fixedLeft: false,
              fixedRight: false,
              footerMethod: null,
              formatter: {
                type: '',
                decimal: 0,
                thousandmark: false,
                currency: ''
              },
              actions: [],
              cascadeFilter: '',
              auxProp: '',
              minWidth: '',
              appWeight: '',
              isDes: false,
              many2one: {
                toTable: '_sys_user',
                toField: 'user_name',
                isDropdown: false,
                customSearch: '',
                multiConnect: '',
                fields: [],
                isFunLayout: true
              },
              align: 'left',
              subQuery: '',
              nodeData: false,
              notDel: false
            },
            {
              fieldID: '392154072452431872',
              field: 'content',
              type: 'json',
              isShow: false,
              notNull: false,
              defValue: '',
              comment: '',
              selectionID: null,
              disabled: true,
              defaultFilter: false,
              fixedLeft: false,
              fixedRight: false,
              nodeData: false,
              footerMethod: null,
              formatter: {
                decimal: 0,
                thousandmark: false,
                currency: ''
              },
              actions: [],
              cascadeFilter: '',
              auxProp: '',
              minWidth: '',
              appWeight: '',
              isDes: false,
              many2one: {
                toTable: '',
                toField: '',
                isDropdown: false,
                customSearch: '',
                multiConnect: '',
                isFunLayout: true,
                fields: []
              },
              align: 'left',
              subQuery: ''
            },

            {
              fieldID: '611390884441559040',
              field: 'respondent',
              type: 'bigint(20)',
              isShow: true,
              notNull: false,
              defValue: '',
              comment: '',
              selectionID: null,
              disabled: false,
              defaultFilter: false,
              fixedLeft: false,
              fixedRight: false,
              nodeData: false,
              footerMethod: null,
              formatter: {
                type: '',
                decimal: 0,
                thousandmark: false,
                currency: ''
              },
              actions: [],
              cascadeFilter: '',
              auxProp: '',
              minWidth: '',
              appWeight: '',
              isDes: false,
              many2one: {
                toTable: '_sys_user',
                toField: 'user_name',
                isDropdown: false,
                customSearch: '',
                multiConnect: '',
                isFunLayout: true,
                fields: []
              },
              align: 'left',
              subQuery: ''
            },
            {
              fieldID: '611391237052502016',
              field: 'response_time',
              type: 'datetime',
              isShow: true,
              notNull: false,
              defValue: '',
              comment: '',
              selectionID: null,
              disabled: false,
              defaultFilter: false,
              fixedLeft: false,
              fixedRight: false,
              nodeData: false,
              footerMethod: null,
              formatter: {
                type: '',
                decimal: 0,
                thousandmark: false,
                currency: ''
              },
              actions: [],
              cascadeFilter: '',
              auxProp: '',
              minWidth: '',
              appWeight: '',
              isDes: false,
              many2one: {
                toTable: '',
                toField: '',
                isDropdown: false,
                customSearch: '',
                multiConnect: '',
                isFunLayout: true,
                fields: []
              },
              align: 'left',
              subQuery: ''
            },
            {
              fieldID: '611399360379162624',
              field: 'is_release',
              type: 'bit(1)',
              isShow: false,
              notNull: false,
              defValue: '0',
              comment: '',
              selectionID: null,
              disabled: false,
              defaultFilter: false,
              fixedLeft: false,
              fixedRight: false,
              nodeData: false,
              footerMethod: null,
              formatter: {
                type: '',
                decimal: 0,
                thousandmark: false,
                currency: ''
              },
              actions: [],
              cascadeFilter: '',
              auxProp: '',
              minWidth: '',
              appWeight: '',
              isDes: false,
              many2one: {
                toTable: '',
                toField: '',
                isDropdown: false,
                customSearch: '',
                multiConnect: '',
                isFunLayout: true,
                fields: []
              },
              align: 'left',
              subQuery: ''
            },
            {
              fieldID: '611399075648835584',
              field: 'is_respond',
              type: 'bit(1)',
              isShow: false,
              notNull: false,
              defValue: '0',
              comment: '',
              selectionID: null,
              disabled: false,
              defaultFilter: false,
              fixedLeft: false,
              fixedRight: false,
              nodeData: false,
              footerMethod: null,
              formatter: {
                type: '',
                decimal: 0,
                thousandmark: false,
                currency: ''
              },
              actions: [],
              cascadeFilter: '',
              auxProp: '',
              minWidth: '',
              appWeight: '',
              isDes: false,
              many2one: {
                toTable: '',
                toField: '',
                isDropdown: false,
                customSearch: '',
                multiConnect: '',
                isFunLayout: true,
                fields: []
              },
              align: 'left',
              subQuery: ''
            }
          ],
          uniqueIndexes: [],
          indexes: [],
          rules: [
            {
              conditions: [
                {
                  field: 'is_respond',
                  type: 'number',
                  operator: '=',
                  value: '0'
                }
              ],
              results: [
                {
                  type: 'row',
                  field: '',
                  backColor: '#F3739F',
                  fontColor: '',
                  fontStyle: false,
                  fontWeight: false,
                  fontDec: false,
                  isDisable: false,
                  isEditable: false
                }
              ]
            }
          ],
          selbill: [],
          queryLink: [],
          action: {},
          headerGroup: [],
          charts: [],
          qbeSearch: {
            enable: true,
            initSpace: 10,
            isInitShow: true,
            position: 'top'
          },
          bancodeScan: {
            enable: false,
            initSpace: 5,
            terminator: '',
            position: 'top'
          },
          toolbar: {
            insert: true,
            default: true,
            delete: true,
            save: true,
            import: true,
            export: true,
            exportXML: true,
            globalSearch: true,
            refresh: true,
            edit: true,
            print: true,
            audit: false,
            unaudit: false,
            requestAudit: false,
            auditStatus: false,
            pasteColumn: false,
            antiAudit: false,
            accountPosted: false,
            cancelPost: false,
            caseclosed: false,
            anticlosing: false,
            freeze: false,
            unfreeze: false,
            void: false,
            addon: [
              {
                checked: false,
                title: 'answer_all_alarms',
                action: 'response',
                icon: 'wy-success-circle-fill',
                children: [],
                initDisabled: false,
                chkEnabled: false,
                initNotshow: false,
                chkShow: false,
                singleSelChk: false,
                readCurrentStatus: false,
                editedShow: false,
                editedEnabled: false
              },
              {
                checked: true,
                title: 'reset_all_alarms',
                action: 'response',
                icon: 'wy-yujing',
                children: [],
                initDisabled: false,
                chkEnabled: false,
                initNotshow: false,
                chkShow: false,
                singleSelChk: false,
                readCurrentStatus: false,
                editedShow: false,
                editedEnabled: false
              }
            ],
            search: true
          },
          tableDataSetting: { editable: true, autoload: true },
          messageConfig: {
            custDefListener: { coordination: '3F2803FCBBD7304B' },
            emitActions: {
              search: [
                {
                  toID: '202214F34D00BB5C',
                  msg: {
                    type: 'search',
                    content: {
                      ikey: 'process_flow_num',
                      ukey: 'master_bill_id',
                      val: ''
                    }
                  },
                  sourceToID: 'process_setting'
                },
                {
                  toID: 'A8F8FE8448999FFC',
                  msg: {
                    type: 'search',
                    content: {
                      ikey: 'hang_group_id',
                      ukey: 'master_bill_id',
                      val: ''
                    }
                  },
                  sourceToID: 'part_info'
                }
              ],
              refresh: []
            },
            eventGroup: {
              alarm_query: {
                custDefListener: { coordination: '3F2803FCBBD7304B' },
                children: [
                  {
                    process_setting: {
                      custDefListener: { coordination: 'AD928BE4D7CBD2AF' },
                      children: []
                    }
                  },
                  {
                    part_info: {
                      custDefListener: { coordination: 'E6E85561105132F0' },
                      children: []
                    }
                  }
                ]
              }
            }
          },
          permission: [
            {
              type: 'columns',
              area: 'table',
              data: {
                alarm_id: 1,
                alarm_tag_num: 1,
                content: 1,
                createor: 1,
                create_time: 1,
                equip_id: 1,
                hang_group_id: 1,
                is_release: 1,
                is_respond: 1,
                last_modify_time: 1,
                last_modify_user: 1,
                process_flow_num: 1,
                release_time: 1,
                respondent: 1,
                response_time: 1,
                _audited_: 1,
                // eslint-disable-next-line camelcase
                _previous_status_: 1,
                _status_: 1
              }
            },
            {
              type: 'customButton',
              area: 'toolbar',
              data: {
                answer_all_alarms: 1,
                reset_all_alarms: 1
              }
            },
            {
              type: 'NULL',
              area: 'default',
              data: {
                browse: 1
              }
            },
            {
              type: 'button',
              area: 'toolbar',
              data: {
                default: 1,
                delete: 1,
                edit: 1,
                export: 1,
                exportXML: 1,
                globalSearch: 1,
                import: 1,
                insert: 1,
                print: 1,
                refresh: 1,
                save: 1
              }
            }
          ],
          funI18nFields: [
            'slc|_audited_|408533419782307840',
            'slc|_previous_status_|408536001896513536',
            'slc|_status_|408536001896513536'
          ],
          funInfo: {
            deputyFunIDs: ['579225892770607104', '579225892791578624'],
            deputyFunInfo: [
              {
                key: '579225892770607104',
                value: 'part_info'
              },
              {
                key: '579225892791578624',
                value: 'process_setting'
              }
            ],
            deputyFuns: ['part_info', 'process_setting'],
            mainFun: 'alarm_query',
            mainFunID: '579225892695109632'
          },
          triggerEvent: { rowDbClick: false, groupByField: [] }
        },
        menu: {
          nav: 'record_query_info',
          navID: '578958337418006528',
          group: 'base_docu',
          parent: ''
        },
        cellID: '1'
      },
      second: {
        name: 'layout',
        type: 'layout',
        config: {
          mode: 'h',
          value: 0.5,
          first: {
            layoutID: 0,
            name: 'cAssPointQuery',
            type: 'comp',
            cellID: '1',
            config: {
              name: 'cAssPointQuery',
              status: 'main',
              originComp: 'custom',
              originName: 'cAssPointQuery',
              permission: [
                { type: 'NULL', area: 'default', data: { browse: 1 } }
              ],
              audit: { hasRequestAudit: false },
              mainFun: 'alarm_query'
            }
          },
          second: {
            moduleID: '13',
            name: 'RefBaseGrid',
            type: 'comp',
            category: 'container',
            config: {
              name: 'part_info',
              comment: '',
              isCreated: true,
              refTable: 'hang_group_detail_mamt',
              status: '',
              tableStyle: {
                showHeader: true,
                showFooter: false,
                showPager: true,
                showToolbar: true,
                border: false,
                mode: null
              },
              editWindow: false,
              tableGraphMode: false,
              dbType: 'mysql',
              tableColumns: [
                {
                  fieldID: '408513584163717120',
                  field: 'createor',
                  type: 'bigint(20)',
                  isShow: false,
                  notNull: false,
                  defValue: '',
                  comment: '',
                  selectionID: null,
                  disabled: true,
                  defaultFilter: false,
                  fixedLeft: false,
                  fixedRight: false,
                  footerMethod: null,
                  formatter: {
                    type: '',
                    decimal: 0,
                    thousandmark: false,
                    currency: ''
                  },
                  actions: [],
                  cascadeFilter: '',
                  auxProp: '',
                  minWidth: '',
                  appWeight: '',
                  isDes: false,
                  many2one: {
                    toTable: '_sys_user',
                    toField: 'user_name',
                    isDropdown: false,
                    customSearch: '',
                    multiConnect: '',
                    fields: [],
                    isFunLayout: true
                  },
                  align: 'left',
                  subQuery: '',
                  nodeData: false,
                  notDel: false
                },
                {
                  fieldID: '222301287968935950',
                  field: 'create_time',
                  type: 'datetime(3)',
                  isShow: false,
                  notNull: false,
                  defValue: '',
                  comment: '',
                  selectionID: null,
                  disabled: true,
                  defaultFilter: false,
                  fixedLeft: false,
                  fixedRight: false,
                  footerMethod: null,
                  formatter: {
                    type: '',
                    decimal: 0,
                    thousandmark: false,
                    currency: ''
                  },
                  actions: [],
                  cascadeFilter: '',
                  auxProp: '',
                  minWidth: '',
                  appWeight: '',
                  isDes: false,
                  many2one: '',
                  align: 'left',
                  subQuery: '',
                  nodeData: false,
                  notDel: false
                },
                {
                  fieldID: '222301287968935948',
                  field: 'last_modify_user',
                  type: 'bigint(20)',
                  isShow: false,
                  notNull: false,
                  defValue: '',
                  comment: '',
                  selectionID: null,
                  disabled: true,
                  defaultFilter: false,
                  fixedLeft: false,
                  fixedRight: false,
                  footerMethod: null,
                  formatter: {
                    type: '',
                    decimal: 0,
                    thousandmark: false,
                    currency: ''
                  },
                  actions: [],
                  cascadeFilter: '',
                  auxProp: '',
                  minWidth: '',
                  appWeight: '',
                  isDes: false,
                  many2one: {
                    toTable: '_sys_user',
                    toField: 'user_name',
                    isDropdown: false,
                    customSearch: '',
                    multiConnect: '',
                    fields: [],
                    isFunLayout: true
                  },
                  align: 'left',
                  subQuery: '',
                  nodeData: false,
                  notDel: false
                },
                {
                  fieldID: '222301287968935947',
                  field: 'last_modify_time',
                  type: 'datetime(3)',
                  isShow: false,
                  notNull: false,
                  defValue: '',
                  comment: '',
                  selectionID: null,
                  disabled: true,
                  defaultFilter: false,
                  fixedLeft: false,
                  fixedRight: false,
                  footerMethod: null,
                  formatter: {
                    type: '',
                    decimal: 0,
                    thousandmark: false,
                    currency: ''
                  },
                  actions: [],
                  cascadeFilter: '',
                  auxProp: '',
                  minWidth: '',
                  appWeight: '',
                  isDes: false,
                  many2one: '',
                  align: 'left',
                  subQuery: '',
                  nodeData: false,
                  notDel: false
                },
                {
                  fieldID: '542658065602727936',
                  field: 'category_number',
                  type: 'varchar(45)',
                  isShow: true,
                  notNull: true,
                  defValue: '',
                  comment: '',
                  selectionID: null,
                  disabled: false,
                  defaultFilter: false,
                  fixedLeft: false,
                  fixedRight: false,
                  nodeData: false,
                  footerMethod: null,
                  formatter: {
                    type: '',
                    decimal: 0,
                    thousandmark: false,
                    currency: ''
                  },
                  actions: [],
                  cascadeFilter: '',
                  auxProp: '',
                  minWidth: '',
                  appWeight: '',
                  isDes: true,
                  many2one: {
                    toTable: '',
                    toField: '',
                    isDropdown: false,
                    customSearch: '',
                    multiConnect: '',
                    isFunLayout: true,
                    fields: []
                  },
                  align: 'left',
                  subQuery: '',
                  placeholder:
                    '零件种类编号，由条码枪扫描自动填入，禁止手动输入'
                },
                {
                  fieldID: '542658628289581056',
                  field: 'type_name',
                  type: 'varchar(45)',
                  isShow: true,
                  notNull: false,
                  defValue: '',
                  comment: '',
                  selectionID: null,
                  disabled: false,
                  defaultFilter: false,
                  fixedLeft: false,
                  fixedRight: false,
                  nodeData: false,
                  footerMethod: null,
                  formatter: {
                    type: '',
                    decimal: 0,
                    thousandmark: false,
                    currency: ''
                  },
                  actions: [],
                  cascadeFilter: '',
                  auxProp: '',
                  minWidth: '',
                  appWeight: '',
                  isDes: false,
                  many2one: {
                    toTable: '',
                    toField: '',
                    isDropdown: false,
                    customSearch: '',
                    multiConnect: '',
                    isFunLayout: true,
                    fields: []
                  },
                  align: 'left',
                  subQuery: ''
                },
                {
                  fieldID: '486974890256113664',
                  field: 'qty',
                  type: 'decimal(20,6)',
                  isShow: true,
                  notNull: false,
                  defValue: '',
                  comment: '',
                  selectionID: null,
                  disabled: false,
                  defaultFilter: false,
                  fixedLeft: false,
                  fixedRight: false,
                  nodeData: false,
                  footerMethod: null,
                  formatter: {
                    type: '',
                    decimal: 0,
                    thousandmark: false,
                    currency: ''
                  },
                  actions: [],
                  cascadeFilter: '',
                  auxProp: '',
                  minWidth: '',
                  appWeight: '',
                  isDes: false,
                  many2one: {
                    toTable: '',
                    toField: '',
                    isDropdown: false,
                    customSearch: '',
                    multiConnect: '',
                    isFunLayout: true,
                    fields: []
                  },
                  align: 'left',
                  subQuery: ''
                },
                {
                  fieldID: '378075409763270656',
                  field: 'master_bill_id',
                  type: 'bigint(20)',
                  isShow: false,
                  notNull: false,
                  defValue: '',
                  comment: '',
                  selectionID: null,
                  disabled: true,
                  defaultFilter: false,
                  fixedLeft: false,
                  fixedRight: false,
                  nodeData: false,
                  footerMethod: null,
                  formatter: {
                    type: '',
                    decimal: 0,
                    thousandmark: false,
                    currency: ''
                  },
                  actions: [],
                  cascadeFilter: '',
                  auxProp: '',
                  minWidth: '',
                  appWeight: '',
                  isDes: false,
                  many2one: {
                    toTable: 'produc_line_detail_mgmt',
                    toField: 'hang_group_num',
                    isDropdown: false,
                    customSearch: '',
                    multiConnect: '',
                    isFunLayout: false,
                    fields: []
                  },
                  align: 'left',
                  subQuery: ''
                },
                {
                  fieldID: '549069322199257088',
                  field: '_audited_',
                  type: 'int(5)',
                  isShow: false,
                  notNull: true,
                  defValue: 0,
                  comment: '',
                  selectionID: '408533419782307840',
                  disabled: true,
                  defaultFilter: false,
                  fixedLeft: false,
                  fixedRight: false,
                  nodeData: false,
                  footerMethod: null,
                  formatter: {
                    type: '',
                    decimal: 0,
                    thousandmark: false,
                    currency: ''
                  },
                  actions: [],
                  cascadeFilter: '',
                  auxProp: '',
                  minWidth: '',
                  appWeight: '',
                  isDes: false,
                  many2one: {
                    toTable: '',
                    toField: '',
                    isDropdown: false,
                    customSearch: '',
                    multiConnect: '',
                    isFunLayout: true,
                    fields: []
                  },
                  align: 'left',
                  subQuery: ''
                },
                {
                  fieldID: '549070605010358272',
                  field: '_status_',
                  type: 'int(5)',
                  isShow: false,
                  notNull: true,
                  defValue: 0,
                  comment: '',
                  selectionID: '408536001896513536',
                  disabled: true,
                  defaultFilter: false,
                  fixedLeft: false,
                  fixedRight: false,
                  nodeData: false,
                  footerMethod: null,
                  formatter: {
                    type: '',
                    decimal: 0,
                    thousandmark: false,
                    currency: ''
                  },
                  actions: [],
                  cascadeFilter: '',
                  auxProp: '',
                  minWidth: '',
                  appWeight: '',
                  isDes: false,
                  many2one: {
                    toTable: '',
                    toField: '',
                    isDropdown: false,
                    customSearch: '',
                    multiConnect: '',
                    isFunLayout: true,
                    fields: []
                  },
                  align: 'left',
                  subQuery: ''
                },
                {
                  fieldID: '549070114536837120',
                  field: '_previous_status_',
                  type: 'int(5)',
                  isShow: false,
                  notNull: true,
                  defValue: 0,
                  comment: '',
                  selectionID: '408536001896513536',
                  disabled: true,
                  defaultFilter: false,
                  fixedLeft: false,
                  fixedRight: false,
                  nodeData: false,
                  footerMethod: null,
                  formatter: {
                    type: '',
                    decimal: 0,
                    thousandmark: false,
                    currency: ''
                  },
                  actions: [],
                  cascadeFilter: '',
                  auxProp: '',
                  minWidth: '',
                  appWeight: '',
                  isDes: false,
                  many2one: {
                    toTable: '',
                    toField: '',
                    isDropdown: false,
                    customSearch: '',
                    multiConnect: '',
                    isFunLayout: true,
                    fields: []
                  },
                  align: 'left',
                  subQuery: ''
                }
              ],
              uniqueIndexes: [],
              indexes: [],
              rules: [],
              selbill: [],
              queryLink: [],
              action: {},
              headerGroup: [],
              charts: [],
              qbeSearch: {
                enable: false,
                initSpace: 5,
                isInitShow: false,
                position: 'top'
              },
              bancodeScan: {
                enable: false,
                initSpace: 5,
                terminator: '',
                position: 'top'
              },
              toolbar: {
                insert: true,
                default: true,
                delete: true,
                save: true,
                import: true,
                export: true,
                exportXML: true,
                globalSearch: true,
                refresh: true,
                edit: true,
                print: true,
                search: true,
                pasteColumn: false,
                addon: []
              },
              tableDataSetting: { editable: true, autoload: false },
              messageConfig: {
                custDefListener: {
                  coordination: 'EDCAE1489E44E41A',
                  search: ['23EFC6A034F8112D']
                },
                emitActions: { search: [], refresh: [] },
                eventGroup: {
                  alarm_query: {
                    custDefListener: { coordination: 'BF8CA198D0F01D53' },
                    children: [
                      {
                        process_setting: {
                          custDefListener: { coordination: '12465AF2403EF61A' },
                          children: []
                        }
                      },
                      {
                        part_info: {
                          custDefListener: { coordination: 'EDCAE1489E44E41A' },
                          children: []
                        }
                      }
                    ]
                  }
                }
              },
              permission: [
                {
                  type: 'button',
                  area: 'toolbar',
                  data: {
                    addon: 1,
                    default: 1,
                    delete: 1,
                    edit: 1,
                    export: 1,
                    exportXML: 1,
                    globalSearch: 1,
                    import: 1,
                    insert: 1,
                    pasteColumn: 1,
                    print: 1,
                    refresh: 1,
                    save: 1,
                    search: 1
                  }
                },
                {
                  type: 'NULL',
                  area: 'default',
                  data: {
                    browse: 1
                  }
                },
                {
                  type: 'columns',
                  area: 'table',
                  data: {
                    category_number: 1,
                    createor: 1,
                    create_time: 1,
                    last_modify_time: 1,
                    last_modify_user: 1,
                    master_bill_id: 1,
                    qty: 1,
                    type_name: 1,
                    _audited_: 1,
                    // eslint-disable-next-line camelcase
                    _previous_status_: 1,
                    _status_: 1
                  }
                }
              ],
              triggerEvent: { rowDbClick: false, groupByField: [] }
            },
            cellID: '2'
          }
        }
      }
    }
  };
}

// 电控表格配置
function getGridOptions() {
  return {
    border: true,
    showHeaderOverflow: true,
    showOverflow: true,
    keepSource: true,
    id: 'full_edit_1',
    height: '100%',
    rowConfig: {
      isHover: true,
      keyField: 'id'
    },
    columnConfig: {
      resizable: true
    },
    customConfig: {
      storage: true
    },
    sortConfig: {
      trigger: 'cell',
      remote: true
    },
    filterConfig: {
      remote: true
    },
    pagerConfig: {
      total: 0, // 总条数
      currentPage: 1, // 当前页
      pageSize: 30, // 每页大小
      align: 'right', // 对齐方式
      pageSizes: [10, 30, 100, 200, 500, 1000],
      iconPrevPage: 'wy-icon wy-shangyiye1',
      iconJumpPrev: 'wy-icon wy-shangyiye',
      iconJumpNext: 'wy-icon wy-xiayiye',
      iconNextPage: 'wy-icon wy-xiayiye1',
      iconJumpMore: 'wy-icon wy-gengduo',
      layouts: [
        'Sizes',
        'FullJump',
        'PrevJump',
        'PrevPage',
        'Number',
        'NextPage',
        'NextJump',
        'Total'
      ],
      perfect: true, // 配套样式
      autoHidden: false // 当只有一页时自动隐藏
    },

    columns: [
      { type: 'seq', title: '序号', width: 50 },
      {
        field: 'f_name',
        title: '点位名称',
        align: 'center'
      },
      {
        field: 't',
        title: '时间',
        align: 'center'
      },

      {
        field: 'v',
        title: '值',
        align: 'center'
      },
      {
        field: 'label',
        title: '标签号',
        align: 'center'
      }
    ]
  };
}

export {
  I_cmd,
  N_cAlarmQuery,
  T_cmd,
  T_srv,
  Tsrv,
  getGridOptions,
  ifs,
  treeConfig,
  ts,
  tvs,
  vue,
  workProcessConfig
};
